package ch05;

class Meal{
	Meal(){
		System.out.println("Meal()");
		System.out.println(i);
		}
	static{
		System.out.println("before Meal()");
	}
	private int i = 4;
}

public class Sandwich extends Meal {
//	private Sandwich sandwich = new Sandwich();
	public static void main(String [] args){
		new Sandwich();
	
	}
	static {
		System.out.println("before Sandwich construction");
	}
	
	private   Integer i = new Integer(2);
}
/**
 * 顺序为先去base 类，在基类中根据顺序。先是初始化static 然后是变量初始化，然后才是构造方法
 */
